(global.webpackJsonp = global.webpackJsonp || []).push([
  ["components/page-component/app-diy-form/app-diy-form"], {
    2821: function (t, e, a) {
      a.r(e);
      var i = a("87eb"),
        n = a.n(i);
      for (var o in i) "default" !== o && function (t) {
        a.d(e, t, function () {
          return i[t]
        })
      }(o);
      e.default = n.a
    },
    "7d93": function (t, e, a) {
      a.r(e);
      var i = a("86c8"),
        n = a("2821");
      for (var o in n) "default" !== o && function (t) {
        a.d(e, t, function () {
          return n[t]
        })
      }(o);
      a("cb70");
      var l = a("2877"),
        u = Object(l.a)(n.default, i.a, i.b, !1, null, "16235a5e", null);
      e.default = u.exports
    },
    "86c8": function (t, e, a) {
      var i = function () {
          var t = this;
          t.$createElement;
          t._self._c, t._isMounted || (t.e0 = function (e) {
            t.showAllItems = !t.showAllItems
          })
        },
        n = [];
      a.d(e, "a", function () {
        return i
      }), a.d(e, "b", function () {
        return n
      })
    },
    "87eb": function (t, e, a) {
      (function (t) {
        Object.defineProperty(e, "__esModule", {
          value: !0
        }), e.default = void 0;
        var i = {
          name: "app-diy-form",
          components: {
            AppTextarea: function () {
              return a.e("components/basic-component/app-textarea/app-textarea").then(a.bind(null, "47cb"))
            },
            AppUploadImage: function () {
              return a.e("components/basic-component/app-upload-image/app-upload-image").then(a.bind(null, "798e"))
            },
            AppDiyFormCheckboxGroup: function () {
              return a.e("components/page-component/app-diy-form/app-diy-form-checkbox-group").then(a.bind(null, "274d"))
            },
            AppRadioGroup: function () {
              return a.e("components/basic-component/app-radio/app-radio-group").then(a.bind(null, "bf87"))
            },
            AppRadio: function () {
              return a.e("components/basic-component/app-radio/app-radio").then(a.bind(null, "3ac8"))
            },
            AppDatetimePicker: function () {
              return a.e("components/basic-component/app-datetime-picker/app-datetime-picker").then(a.bind(null, "3e52"))
            }
          },
          props: {
            sign: {
              default: null
            },
            title: {
              type: String,
              default: null
            },
            backgroundColor: {
              default: "#ffffff"
            },
            backgroundImage: {
              default: null
            },
            backgroundPosition: {
              default: "center"
            },
            backgroundWidth: {
              default: 100
            },
            backgroundHeight: {
              default: 100
            },
            backgroundRepeat: {
              default: "no-repeat"
            },
            marginTop: {
              default: 0
            },
            marginBottom: {
              default: 0
            },
            paddingTop: {
              default: 0
            },
            paddingBottom: {
              default: 0
            },
            list: {
              type: Array,
              default: []
            },
            showRequiredIcon: {
              type: Boolean,
              default: !1
            },
            itemPaddingX: {
              default: 24
            },
            itemMarginY: {
              default: 0
            },
            itemHeight: {
              type: Number,
              default: 88
            },
            showItemBorder: {
              default: !0
            },
            labelPosition: {
              default: "left"
            },
            labelColor: {
              default: "#666666"
            },
            labelTextAlign: {
              default: "right"
            },
            showInputBorder: {
              type: Boolean,
              default: !1
            },
            inputBackground: {
              default: "#ffffff"
            },
            inputBorderColor: {
              default: "#c0c4cc"
            },
            inputTextColor: {
              default: "#666666"
            },
            inputPlaceholderColor: {
              default: "#bbbbbb"
            },
            inputRadius: {
              default: 0
            },
            showSubmit: {
              type: Boolean,
              default: !1
            },
            submitUrl: {
              type: String,
              default: null
            },
            submitBtnText: {
              default: "提交"
            },
            submitBtnHeight: {
              default: 80
            },
            submitBtnPadding: {
              default: 24
            },
            submitBtnMargin: {
              default: 40
            },
            submitBtnRadius: {
              default: 40
            },
            submitBtnBackground: {
              default: "#ff4544"
            },
            submitBtnBorderColor: {
              default: "#ff4544"
            },
            submitBtnTextColor: {
              default: "#ffffff"
            },
            showScrollBtn: {
              default: !1
            }
          },
          data: function () {
            var t = [];
            for (var e in this.list) {
              var a = this.list[e];
              if (void 0 === a.default && (a.default = null), void 0 !== a.value && null !== a.value && "" !== a.value || (a.value = a.default), a.hint = a.hint || "", "radio" === a.key || "checkbox" === a.key)
                for (var i in a.list || (a.list = []), a.list) a.list[i].value && !1 !== a.list[i].value && "false" !== a.list[i].value ? a.list[i].value = !0 : a.list[i].value = !1;
              "img_upload" !== a.key || 2 !== a.img_type && "2" !== a.img_type || a.value || (a.value = ["", ""]), t[e] = a
            }
            return {
              myList: t,
              randomString: "",
              validateResult: {
                hasError: !1,
                errors: []
              },
              showAllItems: !this.showScrollBtn
            }
          },
          computed: {
            itemClass: function () {
              return "left" === this.labelPosition ? "dir-left-nowrap cross-top" : "inset" === this.labelPosition ? "dir-left-nowrap cross-top" : "top" === this.labelPosition ? "label-top" : void 0
            },
            getDateTimeTextPosition: function () {
              return "top" === this.labelPosition ? "left" : "right"
            },
            getInputPaddingLeft: function () {
              return "top" === this.labelPosition ? this.showInputBorder ? 24 : 0 : 24
            }
          },
          created: function () {
            this.validate(), this.outputData()
          },
          methods: {
            textInput: function () {
              this.outputData()
            },
            datetimeChange: function () {
              this.outputData()
            },
            checkChange: function () {
              var t = this;
              setTimeout(function () {
                t.outputData()
              }, 10)
            },
            handleImageUpload: function (t) {
              var e = parseInt(t.sign);
              t.imageList.length > 0 ? this.myList[e].value = t.imageList[0] : this.myList[e].value = "", this.outputData()
            },
            handleUserIdFrontUpload: function (t) {
              var e = parseInt(t.sign);
              t.imageList.length > 0 ? this.myList[e].value[0] = t.imageList[0] : this.myList[e].value[0] = "", this.outputData()
            },
            handleUserIdBackUpload: function (t) {
              var e = parseInt(t.sign);
              t.imageList.length > 0 ? this.myList[e].value[1] = t.imageList[0] : this.myList[e].value[1] = "", this.outputData()
            },
            validate: function () {
              for (var t in this.validateResult = {
                  hasError: !1,
                  errors: []
                }, this.myList) {
                var e = this.myList[t];
                if (1 === e.is_required || "1" === e.is_required) {
                  if (void 0 === e.value || null === e.value || "" === e.value) {
                    this.validateResult.hasError = !0, this.validateResult.errors.push({
                      index: t,
                      msg: '"'.concat(e.name, '"不能为空。')
                    });
                    continue
                  }
                  if (e.img_type && 2 === parseInt(e.img_type)) {
                    if (!e.value || !e.value.length) {
                      this.validateResult.hasError = !0, this.validateResult.errors.push({
                        index: t,
                        msg: '"'.concat(e.name, '"不能为空。')
                      });
                      continue
                    }
                    var a = !1;
                    for (var i in e.value)
                      if (null === e.value[i] || "" === e.value[i]) {
                        a = !0;
                        break
                      } if (a) {
                      this.validateResult.hasError = !0, this.validateResult.errors.push({
                        index: t,
                        msg: '"'.concat(e.name, '"不能为空。')
                      });
                      continue
                    }
                  }
                }
              }
              this.$emit("validate", this.validateResult, this.sign)
            },
            outputData: function () {
              for (var t in this.validate(), this.myList) this.myList[t].label = this.myList[t].name, this.myList[t].required = this.myList[t].is_required;
              this.$emit("input", this.myList, this.sign)
            },
            submit: function () {
              this.outputData(), this.validateResult.hasError && this.validateResult.errors ? t.showModal({
                title: "提示",
                content: this.validateResult.errors[0].msg,
                showCancel: !1
              }) : (t.showLoading({
                mask: !0,
                title: "正在提交..."
              }), this.$request({
                url: this.submitUrl ? this.submitUrl : this.$api.diy.page_store,
                method: "post",
                data: {
                  form_data: JSON.stringify(this.myList)
                }
              }).then(function (e) {
                t.hideLoading(), 0 === e.code ? t.showModal({
                  title: "提示",
                  content: e.msg || "提交成功",
                  showCancel: !1
                }) : t.showModal({
                  title: "提示",
                  content: e.msg || "提交失败",
                  showCancel: !1
                })
              }).catch(function () {
                t.hideLoading()
              }))
            }
          }
        };
        e.default = i
      }).call(this, a("543d").default)
    },
    cb70: function (t, e, a) {
      var i = a("eda12");
      a.n(i).a
    },
    eda12: function (t, e, a) {}
  }
]), (global.webpackJsonp = global.webpackJsonp || []).push(["components/page-component/app-diy-form/app-diy-form-create-component", {
    "components/page-component/app-diy-form/app-diy-form-create-component": function (t, e, a) {
      a("543d").createComponent(a("7d93"))
    }
  },
  [
    ["components/page-component/app-diy-form/app-diy-form-create-component"]
  ]
]);